#!/bin/bash

function Include () { (( $# > 0 )) || return 0
	if [[ -r "$1" ]]; then
		_lc_includes_push "$1" || Warn "appending a filename [$1] to includes list failed"
		source "$1" || Warn "an error occured while including file [$1]"
	else Warn "file to be included [$1] can not be read, skipping"; fi
}
function IncludeOnce () { (( $# > 0 )) || return 0
	_lc_includes_check "$1" || Include "$1"
}
function Require () { (( $# > 0 )) || return 0
	[[ -r "$1" ]] || Die "file to be included [$1] can not be read, aborting"
	_lc_includes_push "$1" || Warn "appending a filename [$1] to includes list failed"
	source "$1" || Die "an error occured while including file [$1], aborting"
}
function RequireOnce () { (( $# > 0 )) || return 0
	_lc_includes_check "$1" || Require "$1"
}
